<%@ page import="com.lib.entity.Admin" %><%--
  Created by IntelliJ IDEA.
  User: Chentuo
  Date: 2023/1/10
  Time: 19:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    Admin admin = (Admin) request.getSession().getAttribute("admin");
%>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>图书管理页面</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="../assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <script src="../assets/js/echarts.min.js"></script>
    <link rel="stylesheet" href="../assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="../assets/css/amazeui.datatables.min.css"/>
    <link rel="stylesheet" href="../assets/css/app.css">
    <script src="../assets/js/jquery.min.js"></script>

</head>

<body data-type="index">
<script src="../assets/js/theme.js"></script>
<div class="am-g tpl-g">
    <!-- 头部 -->
    <header>
        <%--<!-- logo -->
        <div class="am-fl tpl-header-logo">
            <a href="javascript:;"><img src="../assets/img/logo.png" alt=""></a>
        </div>--%>
        <!-- 右侧内容 -->
        <div class="tpl-header-fluid">
            <!-- 侧边切换 -->
            <div class="am-fl tpl-header-switch-button am-icon-list">
                    <span>

                </span>
            </div>

            <!-- 其它功能-->
            <div class="am-fr tpl-header-navbar">
                <ul>
                    <!-- 欢迎语 -->
                    <li class="am-text-sm tpl-header-navbar-welcome">
                        <a href="javascript:;">欢迎你,&nbsp;<span><%=admin.getName()%></span> </a>
                    </li>
                    <!-- 退出 -->
                    <li class="am-text-sm">
                        <a id="quit_href">
                            <span class="am-icon-sign-out"></span> 退出
                        </a>
                    </li>
                </ul>
            </div>
        </div>

    </header>
    <!-- 风格切换 -->
    <div class="tpl-skiner">
        <div class="tpl-skiner-toggle am-icon-cog">
        </div>
        <div class="tpl-skiner-content">
            <div class="tpl-skiner-content-title">
                选择主题
            </div>
            <div class="tpl-skiner-content-bar">
                <span class="skiner-color skiner-white" data-color="theme-white"></span>
                <span class="skiner-color skiner-black" data-color="theme-black"></span>
            </div>
        </div>
    </div>
    <!-- 侧边导航栏 -->
    <div class="left-sidebar">
        <!-- 用户信息 -->
        <div class="tpl-sidebar-user-panel">
            <div class="tpl-user-panel-slide-toggleable">
                <div class="tpl-user-panel-profile-picture">
                    <img src="../assets/img/user-default.png" alt="">
                </div>
                <span class="user-panel-logged-in-text">
                    <i class="am-icon-circle-o am-text-success tpl-user-panel-status-icon"></i>
                    <%=admin.getName()%>
                </span>
            </div>
        </div>

        <!-- 左侧菜单 -->
        <ul class="sidebar-nav">
            <li class="sidebar-nav-link">
                <a href="javascript:;" class="sidebar-nav-sub-title">
                    <i class="am-icon-table sidebar-nav-link-logo"></i> 会员管理
                    <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico"></span>
                </a>
                <ul class="sidebar-nav sidebar-nav-sub">
                    <li class="sidebar-nav-link">
                        <a id="mem_add_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 会员开卡
                        </a>
                    </li>

                    <li class="sidebar-nav-link">
                        <a id="mem_list_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 会员列表
                        </a>
                    </li>

                    <li class="sidebar-nav-link">
                        <a id="mem_charge_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 会员充值
                        </a>
                    </li>
                </ul>
            </li>


            <li class="sidebar-nav-link">
                <a href="javascript:;" class="sidebar-nav-sub-title">
                    <i class="am-icon-table sidebar-nav-link-logo"></i> 图书管理
                    <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico"></span>
                </a>
                <ul class="sidebar-nav sidebar-nav-sub">
                    <li class="sidebar-nav-link">
                        <a id="book_add_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 添加图书
                        </a>
                    </li>

                    <li class="sidebar-nav-link">
                        <a id="book_list_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 图书列表
                        </a>
                    </li>
                </ul>
            </li>


            <li class="sidebar-nav-link">
                <a href="javascript:;" class="sidebar-nav-sub-title">
                    <i class="am-icon-table sidebar-nav-link-logo"></i> 图书类型管理
                    <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico"></span>
                </a>
                <ul class="sidebar-nav sidebar-nav-sub">
                    <li class="sidebar-nav-link">
                        <a id="bookType_add_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 添加类型
                        </a>
                    </li>

                    <li class="sidebar-nav-link">
                        <a id="bookType_list_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 图书类型列表
                        </a>
                    </li>
                </ul>
            </li>


            <li class="sidebar-nav-link">
                <a href="javascript:;" class="sidebar-nav-sub-title">
                    <i class="am-icon-table sidebar-nav-link-logo"></i> 常用操作
                    <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico"></span>
                </a>
                <ul class="sidebar-nav sidebar-nav-sub">
                    <li class="sidebar-nav-link">
                        <a id="book_rent_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 图书借阅
                        </a>
                    </li>

                    <li class="sidebar-nav-link">
                        <a id="return_list_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 图书归还
                        </a>
                    </li>

                    <li class="sidebar-nav-link">
                        <a id="rent_list_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 查看借阅历史信息
                        </a>
                    </li>
                </ul>
            </li>


            <li class="sidebar-nav-link">
                <a href="javascript:;" class="sidebar-nav-sub-title">
                    <i class="am-icon-table sidebar-nav-link-logo"></i> 个人中心
                    <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico"></span>
                </a>
                <ul class="sidebar-nav sidebar-nav-sub">
                    <li class="sidebar-nav-link">
                        <a id="pwd_change_href">
                            <span class="am-icon-angle-right sidebar-nav-link-logo"></span> 修改密码
                        </a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>


    <!-- 内容区域 -->
    <div class="tpl-content-wrapper" id="main_content">

        <div class="container-fluid am-cf">
            <div class="row">
                <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                    <div class="page-header-heading"><span class="am-icon-home page-header-heading-icon"></span>首页
                        <small>图书管理系统</small></div>
                    <p class="page-header-description">欢迎使用图书管理系统</p>
                </div>
            </div>
        </div>
    </div>

</div>
<script src="../assets/js/amazeui.min.js"></script>
<script src="../assets/js/amazeui.datatables.min.js"></script>
<script src="../assets/js/dataTables.responsive.min.js"></script>
<script src="../assets/js/app.js"></script>

<script>
    //账号退出
    $("#quit_href").click(function () {
        $.ajax({
            type: 'post',
            url: "<%=path%>/admin/AdminLoginoutServlet.do",
            success: function (result) {
                var jsonResult = $.parseJSON(result);
                if (jsonResult.state == 1000) {
                    window.location.replace("<%=path%>/admin/jsp/login.jsp")
                } else {
                    alert("退出失败");
                }
            }
        });
    });
    //会员开卡
    $("#mem_add_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/mem-add2.jsp");
    });
    //会员列表
    $("#mem_list_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/mem-list2.jsp");
    });
    //会员充值
    $("#mem_charge_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/mem-charge2.jsp");
    });
    //添加图书
    $("#book_add_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/book-add.jsp");
    });
    //图书列表
    $("#book_list_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/book-list.jsp");
    });
    //添加图书类型
    $("#bookType_add_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/type-add2.jsp");
    });
    //图书列表
    $("#bookType_list_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/type-list2.jsp");
    });
    //图书借阅
    $("#book_rent_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/book-rent.jsp");
    });
    //图书归还
    $("#return_list_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/book-return.jsp");
    });
    //借阅历史列表
    $("#rent_list_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/record-list.jsp");
    });
    //修改个人密码
    $("#pwd_change_href").click(function () {
        $("#main_content").load("<%=path%>/admin/jsp/pwd-change2.jsp");
    });
</script>
</body>
</html>
